package edu.cuit.avatar.recursive;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/14 9:02
 */
public class Fib {
    public static int fib(int index) {
        if(index == 0)
            return 0;
        else if (index == 1)
            return 1;
        else return fib(index - 1) + fib(index - 2);
    }

    public static void main(String[] args) {
        for(int i = 0; i <= 10; i++) {
            System.out.print(fib(i) + "  ");
        }
    }
}
